<script setup lang="ts">
type Props = {
  title?: string
  rightText?: string
}
defineProps<Props>()
const emit = defineEmits<{
  (event: 'click-right'): void
  (event: 'click-left'): void
}>()
const onClickLeft = () => {
  // TODO 点击左侧返回按钮
  emit('click-left')
}
const onClickRight = () => {
  // TODO 点击右侧文字按钮
  emit('click-right')
}
</script>

<template>
  <van-nav-bar
    fixed
    left-arrow
    :title="title"
    :right-text="rightText"
    @click-left="onClickLeft"
    @click-right="onClickRight"
  ></van-nav-bar>
</template>

<style lang="scss" scoped>
:deep() {
  .van-nav-bar {
    &__arrow {
      font-size: 18px;
      color: var(--cp-text1);
    }

    &__text {
      font-size: 15px;
    }
  }
}
</style>
